import os
import pickle
import numpy as np
import pandas as pd

base_dir = './data/'

def load_aiops18_data(metric_name):
    metric_dir = os.path.join(base_dir, 'aiops18/')
    with open(os.path.join(metric_dir, 'train_data_dict.pkl'), 'rb') as pickle_reader:
        train = pickle.load(pickle_reader)
    with open(os.path.join(metric_dir, 'test_data_dict.pkl'), 'rb') as pickle_reader:
        test = pickle.load(pickle_reader)

    train_metric = train[metric_name]
    train_metric_values = train_metric[0]
    train_metric_labels = train_metric[1]

    test_metric = test[metric_name]
    test_metric_values = test_metric[0]
    test_metric_labels = test_metric[1]

    return train_metric_values, train_metric_labels, test_metric_values, test_metric_labels

